package com.example.match.model.enums;

/**
 * 队伍状态枚举
 */
public enum TeamStatusEnum {

    PUBLIC(0, "公开"),
    PRIVATE(1, "私有"),
    SECRET(2, "加密");

    private int code;

    private String text;

    public static TeamStatusEnum getEnumByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (TeamStatusEnum value : TeamStatusEnum.values()) {
            if (value.getCode() == code)
                return value;
        }
        return null;
    }

    TeamStatusEnum(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public int getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setText(String text) {
        this.text = text;
    }
}
